﻿using System;
using System.Windows.Forms;
using System.Xml.Linq;

namespace Microsoft.Office.OneNote.XmlViewer.Controls.Views
{
    public partial class ViewBase : UserControl
    {
        private string _statusText;

        public event EventHandler StatusTextChanged;

        public ViewBase()
        {
            InitializeComponent();
        }

        public string StatusText
        {
            get { return _statusText; }
            protected set
            {
                if (_statusText != value)
                {
                    _statusText = value;
                    OnStatusTextChanged(EventArgs.Empty);
                }
            }
        }

        public virtual void LeaveCurrentObject()
        {
        }

        public virtual void Navigate(OneNoteHierarchyObject obj)
        {
        }

        public virtual void Navigate(XDocument doc)
        {
        }

        public virtual void Navigate(OneNoteHierarchy hierarchy)
        {
        }

        protected virtual void OnStatusTextChanged(EventArgs e)
        {
            if (StatusTextChanged != null)
            {
                StatusTextChanged(this, e);
            }
        }

    }
}
